<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "fee_item".
 *
 * @property integer $id
 * @property integer $cust_id
 * @property integer $item
 * @property integer $fee
 * @property string $fee_month
 *
 * @property Customer $cust
 */
class FeeItem extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'fee_item';
    }
	
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['cust_id', 'fee', 'item'], 'integer'],
            [['fee_month'], 'string', 'max' => 10],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'cust_id' => Yii::t('app', 'Cust ID'),
            'item' => Yii::t('app', 'Item'),
            'fee' => Yii::t('app', 'Fee'),
            'fee_month' => Yii::t('app', 'Fee Month'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCust()
    {
        return $this->hasOne(Customer::className(), ['cust_id' => 'cust_id']);
    }
    
    public function getItemType(){
        $item_type_list = [
            1 => Yii::t('app', 'Fee item 1'),
            2 => Yii::t('app', 'Fee item 2'),
            3 => Yii::t('app', 'Fee item 3'),
            4 => Yii::t('app', 'Fee item 4'),
            5 => Yii::t('app', 'Fee item 5'),
            6 => Yii::t('app', 'Fee item 6'),
            7 => Yii::t('app', 'Fee item 7')
        ];

        return $item_type_list;
    }
}
